<%--
  Created by IntelliJ IDEA.
  User: 樊旺
  Date: 2020/9/2
  Time: 17:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>Title</title>
</head>
<link type="text/css" rel="stylesheet"
      href="static/bootstrap/css/bootstrap.min.css" />
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->

<body>
<div class="container">
    <script type="text/javascript"
            src="static/bootstrap/js/jquery-3.4.1.min.js"></script>
    <script type="text/javascript"
            src="static/bootstrap/js/bootstrap.min.js"></script>
    <div class="row">
        <div class="col-md-12">
            <span class="glyphicon glyphicon-trash"><a id="delall" href="user?action=deleteAll">全部删除</a></span>
            <span class="glyphicon glyphicon-remove"><a id="del" href="user?action=deleteAll">选中删除</a></span>
            <span class="glyphicon glyphicon-plus" class="btn btn-primary btn-lg"
                  data-toggle="modal" data-target="#myModal"><a href="#">新增</a></span>
        </div>
    </div>

    <div class="row">
        <table class="table table-hover">
            <tr>
                <td></td>
                <td>用户名</td>
                <td>邮箱</td>
                <td>性别</td>
                <td>状态码</td>
                <td>角色</td>
                <td>激活状态</td>
                <td>操作</td>
            </tr>
         <c:forEach items="${list}" var="user">
                <tr>
                    <td><input type="checkbox" name="ids" value="${user.uid}"></input></td>
                    <td>${user.uname}</td>
                    <td>${user.uemail}</td>
                    <td>${user.ugender}</td>
                    <td>${user.uflag}</td>
                    <td>${user.urole}</td>
                    <td>${user.ucode}</td>
                    <td><a href="user?action=selectOne&id=${user.uid}">修改</a></td>
                </tr>
            </c:forEach>

            <tr>
                <td colspan="8" align="center" >
                    <nav aria-label="Page navigation">
                        <ul class="pagination">
                            <li><a id="upPage"
                                    href="${plist.prePage}"
                                    aria-label="Previous"> <span aria-hidden="true">&laquo;</span>
                            </a></li>
                            <li><a href="#">第${plist.pageNum}页</a></li>
                            <li><a href="#">共${plist.pages}页</a></li>
                            <li><a href="#">每页显示${plist.pageSize}条数据</a></li>
                            <li><a href="#">共条${plist.total}数据</a></li>
                            <li><a href="">末页</a></li>
                            <li><a href="${plist.nextPage}"
                                   aria-label="Next"> <span aria-hidden="true">&raquo;</span>
                            </a></li>
                        </ul>
                    </nav>
                </td>
            </tr>
        </table>
    </div>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <form action="u">
            <input type="hidden" name="action" value="add">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"
                            aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title" id="myModalLabel">新增用户</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label id="username">用户名:</label> <input type="text"
                                                                  class="form-control" name="username" placeholder="6-20个字母或数字组成的用户名">
                    </div>
                    <div class="form-group">
                        <label id="userpass">密码:</label> <input type="password"
                                                                 class="form-control" name="userpass" placeholder="6位数字组成">
                    </div>
                    <div class="form-group">
                        <label id="userpass2">重复密码:</label> <input type="password"
                                                                    class="form-control" name="userpass2" placeholder="与原密码一致">
                    </div>
                    <div class="form-group">
                        <label id="exampleInputEmail1">邮箱地址:</label> <input type="email"
                                                                             class="form-control" name="useremail" placeholder="按邮箱格式填写">
                    </div>
                    <div class="form-group">
                        <label class="control-label" id="usersex">性别：</label><input
                            type="radio" class="form-control" name="usersexy" value="男">男
                        <input type="radio" class="form-control" name="usersexy" value="女">女
                    </div>
                    <div class="form-group">
                        <label id="flag">状态:</label> <input type="text"
                                                                           class="form-control" name="flag" placeholder="1为存在，0为不存在">
                    </div>
                    <div class="form-group">
                        <label id="role">角色:</label> <input type="text"
                                                                           class="form-control" name="role" placeholder="1为用户，0为管理员">
                    </div>
                    <div class="form-group">
                        <label id="code">激活码:</label> <input type="text"
                                                                            class="form-control" name="code" placeholder="1为激活，0为未激活">
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="submit" class="btn btn-primary">确认添加</button>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
</html>
